<?php

namespace App\Models\Admin;

use App\Models\BaseModel;
class RoleModel extends BaseModel
{

    /**
     * 角色表
     * @var string
     */
    protected $table = 'admin_role';

    /**
     * 主键是否主动递增
     *
     * @var bool
     */
    public $incrementing = false;

    /**
     * 不可批量赋值属性
     *
     * @var array
     */
    protected $guarded = ['id'];


  /**
   * The attributes excluded from the model's JSON form.
   *
   * @var array
   */
  protected $hidden = [
    'deleted_at','created_at','updated_at','laravel_through_key'
  ];

    public function routes(){
      return $this->hasManyThrough(MenuModel::class,RoleMenuRightModel::class, 'role_id', 'id', 'id', 'menu_id');
    }

}
